package com.thx.tags;

import com.opensymphony.xwork2.util.ValueStack;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ComponentTagSupport;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 自定义select标签.
 * 
 * @author shiyan
 */
public class UserTag extends ComponentTagSupport {

  private String id;

  private String cssClass;

  private String value;

  private String href;

  private String onClick;

  private boolean more;


  @Override
  public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
    return new User(stack, req);
  }

  protected void populateParams() {
    super.populateParams();
    User user = (User) component;
    user.setId(id);
    user.setCssClass(cssClass);
    user.setHref(href);
    user.setMore(more);
    user.setValue(value);
    user.setOnClick(onClick);
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getCssClass() {
    return cssClass;
  }

  public void setCssClass(String cssClass) {
    this.cssClass = cssClass;
  }

  public String getValue() {
    return value;
  }

  public void setValue(String value) {
    this.value = value;
  }

  public String getHref() {
    return href;
  }

  public void setHref(String href) {
    this.href = href;
  }

  public String getOnClick() {
    return onClick;
  }

  public void setOnClick(String onClick) {
    this.onClick = onClick;
  }

  public boolean getMore() {
    return more;
  }

  public void setMore(boolean more) {
    this.more = more;
  }

}
